import { Form, Input, InputNumber } from 'antd'

import GlobalUpload from '@/commponents/common/GlobalUpload'

export default function () {
  return [
    {
      title: '图片',
      dataIndex: 'pic',
      type: 'pic',
      render: (index: number) => (
        <Form.Item name={[index, 'pic']}>
          <GlobalUpload />
        </Form.Item>
      ),
    },
    {
      title: '售价',
      dataIndex: 'price',
      type: 'input-number',
      render: (index: number) => (
        <Form.Item name={[index, 'price']}>
          <InputNumber />
        </Form.Item>
      ),
    },
    {
      title: '成本价',
      dataIndex: 'cost',
      type: 'input-number',
      render: (index: number) => (
        <Form.Item name={[index, 'cost']}>
          <InputNumber />
        </Form.Item>
      ),
    },
    {
      title: '原价',
      dataIndex: 'ot_price',
      type: 'input-number',
      render: (index: number) => (
        <Form.Item name={[index, 'ot_price']}>
          <InputNumber />
        </Form.Item>
      ),
    },
    {
      title: '库存',
      dataIndex: 'stock',
      type: 'input-number',
      render: (index: number) => (
        <Form.Item name={[index, 'stock']}>
          <InputNumber />
        </Form.Item>
      ),
    },
    {
      title: '商品编号',
      type: 'input',
      dataIndex: 'bar_code',
      render: (index: number) => (
        <Form.Item name={[index, 'bar_code']}>
          <Input />
        </Form.Item>
      ),
    },
    {
      title: '重量(KG)',
      dataIndex: 'weight',
      type: 'input-number',
      render: (index: number) => (
        <Form.Item name={[index, 'weight']}>
          <InputNumber step={0.1} />
        </Form.Item>
      ),
    },
    {
      title: <span>体积(m{<sup>3</sup>})</span>,
      dataIndex: 'volume',
      type: 'input-number',
      render: (index: number) => (
        <Form.Item name={[index, 'volume']}>
          <InputNumber step={0.1} />
        </Form.Item>
      ),
    },
  ]
}
